#ifndef    USER_APP
#define USER_APP
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbconfig.h"
#include "mbframe.h"
#include "mbutils.h"

/* -----------------------Slave Defines -------------------------------------*/
#define S_DISCRETE_INPUT_START        0
#define S_DISCRETE_INPUT_NDISCRETES   16
#define S_COIL_START                  0
#define S_COIL_NCOILS                 64
#define S_REG_INPUT_START             0
#define S_REG_INPUT_NREGS             100
#define S_REG_HOLDING_START           0
#define S_REG_HOLDING_NREGS           100
/* salve mode: holding register's all address */
#define          S_HD_RESERVE                     0
#define          S_HD_CPU_USAGE_MAJOR             1
#define          S_HD_CPU_USAGE_MINOR             2
/* salve mode: input register's all address */
#define          S_IN_RESERVE                     0
/* salve mode: coil's all address */
#define          S_CO_RESERVE                     0
/* salve mode: discrete's all address */
#define          S_DI_RESERVE                     0


/*----------------------------------------
*         划分保持寄存器的类型区域            
*========================================
* 0 |从机地址
*-----------------------------------------
* 1 |X轴角度 
*-----------------------------------------
* 2 |Y轴角度
*-----------------------------------------
* 3 |Z轴角度
*-----------------------------------------
*/
#define S_SLAVEID_REG_START S_REG_HOLDING_START
#define S_SLAVEID_REG_NUM  1
#define S_SLAVEID_REG_END S_SLAVEID_REG_START+S_SLAVEID_REG_NUM

#define S_XANGLE_REG_START S_SLAVEID_REG_END
#define S_XANGLE_REG_NUM 1
#define S_XANGLE_REG_END S_XANGLE_REG_START+S_XANGLE_REG_NUM

#define S_YANGLE_REG_START S_XANGLE_REG_END
#define S_YANGLE_REG_NUM 1
#define S_YANGLE_REG_END S_YANGLE_REG_START+S_YANGLE_REG_NUM

#define S_ZANGLE_REG_START S_YANGLE_REG_END
#define S_ZANGLE_REG_NUM 1
#define S_ZANGLE_REG_END S_ZANGLE_REG_START+S_ZANGLE_REG_NUM






#endif
